<!DOCTYPE html>
<html>
<head>
    <title>入库记录</title>
    #parse("sys/header.html")
    <style>
        .sugon_upload_btn {
            display: -webkit-inline-box;
            display: inline-block;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div id="reviewLayer" style="display: none;">
        <form class="form-horizontal" style="width: 350px;">
            <div class="form-group">
                <div class="form-group">
                    <div class="col-sm-2 control-label">系统编码</div>
                    <span class="label label-success" style="vertical-align: bottom;">{{toolsPartIn.partCode}}</span>
                </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">名称</div>
                    <span class="label label-success" style="vertical-align: bottom;">{{toolsPartIn.name}}</span>
                </div>
            </div>
        </form>
    </div>
	<div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="3">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.mapNo" @on-enter="query" placeholder="图号"></i-input>
                </i-col>
                <i-col span="3">
                    <i-input v-model="q.type" @on-enter="query" placeholder="规格"></i-input>
                </i-col>
                <i-col span="3">
                    <Date-picker type="date" v-model="q.beginTime" placeholder="入库查询开始时间"></Date-picker>
                </i-col>
                <i-col span="3">
                    <Date-picker type="date" v-model="q.endTime" placeholder="入库查询结束时间"></Date-picker>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("toolsPartIn:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("toolsPartIn:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
    </div>
    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="toolsPartIn" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="工装名称" prop="name">
                        <i-input v-model="toolsPartIn.name" placeholder="名称" readonly icon="md-arrow-dropdown-circle" @on-click="selectTools" ></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="工装编码" prop="partCode">
                        <i-input v-model="toolsPartIn.partCode" placeholder="工装编码" readonly icon="md-arrow-dropdown-circle" @on-click="selectTools"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="型号规格" prop="type">
                        <i-input v-model="toolsPartIn.type" placeholder="型号规格" readonly></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="图号" prop="mapNo">
                        <i-input v-model="toolsPartIn.mapNo" placeholder="图号" readonly></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="来源" prop="resources">
                        <i-select v-model="toolsPartIn.resources" placeholder="来源">
                            <i-option v-for="source in sourceList" :value="source.value" :key="source.value">{{source.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row v-show="toolsPartIn.resources == 4">
                <i-col span="11">
                    <Form-item label="关联计划">
                        <i-input v-model="planItemDesc" placeholder="备件需求项唯一码" readonly icon="md-arrow-dropdown-circle" @on-click="relateNeedsPlanDetail" ></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="单价">
                        <i-input v-model="partPrice" placeholder="单价" readonly></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="入库仓库" prop="intStore">
                        <i-input v-model="toolsPartIn.intStore" v-show="false"></i-input>
                        <i-input v-model="storeName" placeholder="入库仓库" readonly icon="md-arrow-dropdown-circle" @on-click="getStoreHouse"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11" v-show="flag == 0" offset="2">
                    <Form-item label="货位" prop="cargoLocation" >
                        <i-select v-model="toolsPartIn.cargoLocation" style="width: 80%" >
                            <i-option v-for="obj in optionList" :value="obj.id" :key="obj.id">{{obj.postion}} 库存：{{obj.storeNum}}
                            </i-option>
                        </i-select>
                        <i-button type="info" @click="showLoc(0)" style="width: 15%">&nbsp;其它</i-button>
                    </Form-item>
                </i-col>
                <i-col span="11" v-show="flag == 1" offset="2">
                    <Form-item label="新货位" prop="cargoLocationName" >
                        <i-input v-model="toolsPartIn.cargoLocationName"  style="width: 80%"></i-input>
                        <i-button type="info" @click="showLoc(1)" style="width: 15%">&nbsp;选择</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
               <i-col span="11"  >
                   <Form-item label="入库数量" prop="inNum">
                       <i-input type="number" v-model="toolsPartIn.inNum" placeholder="入库数量"></i-input>
                   </Form-item>
               </i-col>
                <i-col span="11" offset="2">
                    <Form-item label="备注" prop="remark">
                        <i-input type="textarea" v-model="toolsPartIn.remark" placeholder="备注"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')" :disabled="isDisabled">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/tools/toolspartin.js?_${date.systemTime}"></script>
</body>
</html>
